<script type="text/javascript">
    function avatarUploadSuccess(file, data) {
        var data = $.parseJSON(data);
        $(this).bjuiajax("ajaxDone", data);
        if (data["statusCode"] == 200) {
            $.CurrentNavtab.find("#thumb").val(data["data"]["filename"]);
            $.CurrentNavtab.find("#thumbImg").html("<img src='" + data["data"]["filename"] + "' width='150' />");
        }
    }
</script>
<div class="bjui-pageContent">
    <form action="{:U('Admin/Bases/updBase')}" data-toggle="validate" data-alertmsg="false">
        <input type="hidden" name="baseId" value="{$baseInfo.id}">
        <table class="table table-condensed table-hover" width="100%">
            <tbody>
                <tr>
                    <td>
                        <label for="name" class="control-label x85">基地名称：</label>
                        <input type="text" name="name" id="name" value="{$baseInfo.name}" data-rule="required" size="20">
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="thumb" class="control-label x85">基地缩略图：</label>
                        <div style="display:inline-block;vertical-align:middle;">
                            <div id="j_custom_pic_up" data-toggle="upload" data-uploader="{:U('Admin/Bases/uploadThumb')}" 
                                 data-file-size-limit="2097152"
                                 data-file-type-exts="*.jpg;*.jpeg;*.png;*.gif;*.mpg"
                                 data-multi="false"
                                 data-on-upload-success="avatarUploadSuccess"
                                 data-icon="cloud-upload">
                            </div>
                            <input type="hidden" name="thumb" value="{$baseInfo.thumb}" id="thumb">
                            <span id="thumbImg">
                                <notempty name="baseInfo.thumb">
                                    <img src="{$baseInfo.thumb}" width="150" />
                                </notempty>
                            </span>
                        </div>
                        <span>(图片尺寸：50*50)</span>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="area" class="control-label x85">基地面积：</label>
                        <input type="text" name="area" id="area" size="20" value="{$baseInfo.area}" data-rule="required">
                        <span>(平方米)</span>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="addr" class="control-label x85">基地地址：</label>
                        <textarea name="addr" id="addr" rows="5" cols="50">{$baseInfo.addr}</textarea>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="remark" class="control-label x85">备注说明：</label>
                        <textarea name="remark" id="remark" rows="5" cols="50">{$baseInfo.remark}</textarea>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li><button type="button" class="btn-close" data-icon="close">取消</button></li>
        <li><button type="submit" class="btn-default" data-icon="save">更新</button></li>
    </ul>
</div>